package com.crm.hudingjie.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.crm.hudingjie.model.jdao.IDeptDAO;
import com.crm.model.pojo.Book;

@Service
public class DeptServices {
	@Autowired
	private IDeptDAO deptDAO;
	
	//测试JPA方式的流程是否通畅
	public void addDept(int  bookId,int categoryId,int damage,int status) {
		Book dept = new Book();
		dept.setBookId(bookId);
		dept.setCategoryId(categoryId);
		dept.setDamage(damage);
		dept.setStatus(status);
		deptDAO.save(dept);
		System.out.println("新增之后的主键id是："+dept.getBookId());
	}
	
	/*public void allbook() {
		List<Book> selectAll = deptDAO.findBybookIdAndCategoryId(1000,101);
		for (Book book : selectAll) {
			System.out.println(book.getBookId());
		}*/
	}
	
	

